// ==========================================================================
// gin-sns auto gen code.
// date：2021-02-21 13:45:54 +0800 CST
// path: app/model/module/user/user_entity.go
// author：jon
// ==========================================================================

package user

import (
	"time"
)

// 数据表映射结构体
type Entity struct {
	Id            int64     `json:"id" xorm:"not null pk autoincr comment('') bigint(20)"`
	UserName      string    `json:"user_name" xorm:"comment('用户名') varchar(50)"`
	UserMobile    string    `json:"user_mobile" xorm:"comment('手机') varchar(20)"`
	UserEmail     string    `json:"user_email" xorm:"comment('Email') varchar(255)"`
	Password      string    `json:"password" xorm:"comment('密码') varchar(100)"`
	Type          int       `json:"type" xorm:"comment('类型') int(11)"`
	Nickname      string    `json:"nickname" xorm:"comment('昵称') varchar(50)"`
	Sex           int       `json:"sex" xorm:"comment('性别1男2女3保密') tinyint(1)"`
	Avatar        string    `json:"avatar" xorm:"comment('头像') varchar(255)"`
	Work          string    `json:"work" xorm:"comment('工作职位') varchar(100)"`
	Signature     string    `json:"signature" xorm:"comment('个性签名') varchar(100)"`
	Description   string    `json:"description" xorm:"comment('自我介绍') text"`
	Province      int       `json:"province" xorm:"comment('所在省') int(11)"`
	City          int       `json:"city" xorm:"comment('所在城市') int(11)"`
	Area          int       `json:"area" xorm:"comment('所在地区') int(11)"`
	ContactAddr   string    `json:"contact_addr" xorm:"comment('联系地址') varchar(250)"`
	CountFollower int64     `json:"count_follower" xorm:"comment('被关注数量') bigint(20)"`
	CountFollowee int64     `json:"count_followee" xorm:"comment('关注数量') bigint(20)"`
	CountQuestion int64     `json:"count_question" xorm:"comment('被关注数量') bigint(20)"`
	CountAnswer   int64     `json:"count_answer" xorm:"comment('被关注数量') bigint(20)"`
	CountPost     int64     `json:"count_post" xorm:"comment('被关注数量') bigint(20)"`
	CountBlog     int64     `json:"count_blog" xorm:"comment('被关注数量') bigint(20)"`
	Level         int       `json:"level" xorm:"comment('级别') tinyint(2)"`
	Integral      int64     `json:"integral" xorm:"comment('积分') bigint(20)"`
	Status        int       `json:"status" xorm:"comment('0未审核 1正常状态 2审核未通过 3删除') tinyint(2)"`
	CreateTime    time.Time `json:"create_time" xorm:"comment('创建时间') datetime"`
	UpdateTime    time.Time `json:"update_time" xorm:"comment('更新时间') datetime"`
}

type SignupReq struct {
	UserName   string `form:"username" json:"username" binding:"required"`
	Password   string `form:"password" json:"password" `
	RePassword string `form:"rePassword" json:"rePassword" `
	NickName   string `form:"nickname" json:"nickname" binding:"required"`
	Ref        string `form:"ref" json:"ref" `
}

type SigninReq struct {
	UserName   string `form:"username" json:"username" binding:"required"`
	Password   string `form:"password" json:"password" `
	RePassword string `form:"rePassword" json:"rePassword" `
	Ref        string `form:"ref" json:"ref" `
}

//新增页面请求参数
type AddReq struct {
	UserName      string `form:"userName" binding:"required"`
	UserMobile    string `form:"userMobile" `
	UserEmail     string `form:"userEmail" `
	Password      string `form:"password" `
	Type          int    `form:"type" `
	Nickname      string `form:"nickname" binding:"required"`
	Sex           int    `form:"sex" `
	Avatar        string `form:"avatar" `
	Work          string `form:"work" `
	Signature     string `form:"signature" `
	Description   string `form:"description" `
	Province      int    `form:"province" `
	City          int    `form:"city" `
	Area          int    `form:"area" `
	ContactAddr   string `form:"contactAddr" `
	CountFollower int64  `form:"countFollower" `
	CountFollowee int64  `form:"countFollowee" `
	CountQuestion int64  `form:"countQuestion" `
	CountAnswer   int64  `form:"countAnswer" `
	CountPost     int64  `form:"countPost" `
	CountBlog     int64  `form:"countBlog" `
	Level         int    `form:"level" `
	Integral      int64  `form:"integral" `
	Status        int    `form:"status" binding:"required"`
}

//修改页面请求参数
type EditReq struct {
	Id            int64  `form:"id" binding:"required"`
	UserName      string `form:"userName" binding:"required不能为空"`
	UserMobile    string `form:"userMobile" `
	UserEmail     string `form:"userEmail" `
	Password      string `form:"password" `
	Type          int    `form:"type" `
	Nickname      string `form:"nickname" binding:"required不能为空"`
	Sex           int    `form:"sex" `
	Avatar        string `form:"avatar" `
	Work          string `form:"work" `
	Signature     string `form:"signature" `
	Description   string `form:"description" `
	Province      int    `form:"province" `
	City          int    `form:"city" `
	Area          int    `form:"area" `
	ContactAddr   string `form:"contactAddr" `
	CountFollower int64  `form:"countFollower" `
	CountFollowee int64  `form:"countFollowee" `
	CountQuestion int64  `form:"countQuestion" `
	CountAnswer   int64  `form:"countAnswer" `
	CountPost     int64  `form:"countPost" `
	CountBlog     int64  `form:"countBlog" `
	Level         int    `form:"level" `
	Integral      int64  `form:"integral" `
	Status        int    `form:"status" binding:"required不能为空"`
}

//分页请求参数
type SelectPageReq struct {
	UserName      string `form:"userName"`      //用户名
	UserMobile    string `form:"userMobile"`    //手机
	UserEmail     string `form:"userEmail"`     //Email
	Password      string `form:"password"`      //密码
	Type          int    `form:"type"`          //类型
	Nickname      string `form:"nickname"`      //昵称
	Sex           int    `form:"sex"`           //性别1男2女3保密
	Avatar        string `form:"avatar"`        //头像
	Work          string `form:"work"`          //工作职位
	Signature     string `form:"signature"`     //个性签名
	Description   string `form:"description"`   //自我介绍
	Province      int    `form:"province"`      //所在省
	City          int    `form:"city"`          //所在城市
	Area          int    `form:"area"`          //所在地区
	ContactAddr   string `form:"contactAddr"`   //联系地址
	CountFollower int64  `form:"countFollower"` //被关注数量
	CountFollowee int64  `form:"countFollowee"` //关注数量
	CountQuestion int64  `form:"countQuestion"` //被关注数量
	CountAnswer   int64  `form:"countAnswer"`   //被关注数量
	CountPost     int64  `form:"countPost"`     //被关注数量
	CountBlog     int64  `form:"countBlog"`     //被关注数量
	Level         int    `form:"level"`         //级别
	Integral      int64  `form:"integral"`      //积分
	Status        int    `form:"status"`        //0未审核 1正常状态 2审核未通过 3删除
	BeginTime     string `form:"beginTime"`     //开始时间
	EndTime       string `form:"endTime"`       //结束时间
	PageNum       int    `form:"pageNum"`       //当前页码
	PageSize      int    `form:"pageSize"`      //每页数
}
